1. Field of the Invention
The present invention relates to an image generation apparatus suitable for use with apparatuses utilizing computer graphics such as video game machines and graphic computers which must perform a high level of visualization using limited hardware resources. More particularly, the present invention relates to the so-called semitransparent process.
2. Description of the Related Art
In the art of computer graphics, the systems normally referred to as 3D (three-dimensional) graphics systems draw an image of an object which gives the sense of reality (hereinafter an object to be drawn will be simply referred to as an object) by first dividing the surface of the object into a plurality of polygons (xe2x80x9cpolygonsxe2x80x9d are the smallest units of figures treated by a drawing device (triangles and quadrangles)) and by drawing those polygons sequentially in a frame memory associated with a monitor display screen (herein after referred to as a frame buffer) to reconstruct an image which has a three-dimensional appearance.
In a normal image generation apparatus of this type, a dedicated drawing device is provided between the CPU and frame buffer in order to improve the processing speed. During the generation of an image, the CPU does not directly access the frame buffer, but generates commands (hereinafter simply referred to as draw commands) to draw basic figures such as triangles and quadrangles (polygons) and sends them to the drawing device. The drawing device interprets the draw commands and draws the figures in the frame buffer.
In computer graphics systems, the pixel data (throughout this specification, such data is constituted by, for example, data of three primary colors) of the image which has been previously displayed is mixed with the pixel data of the next image to be drawn in a predetermined ratio to perform a semitransparent process. The semitransparent process is performed by a drawing device, and a semi-transparent process portion of a drawing device has been configured as shown in FIG. 11 in the prior art.
In FIG. 11, 10 designates a frame buffer and 20 designates a drawing device. The drawing device 20 includes a mixing circuit 21 for a semitransparent process, a read circuit 22 for reading pixel data from the frame buffer 10, a write circuit 23 for writing pixel data in the frame buffer 10, a draw command decoding portion 24 for decoding a draw command transmitted to the drawing device 20, an image generation circuit 25 for generating an image in accordance with the draw command decoded by the draw command decoding portion 24, a mixing ratio memory 26, and a control portion 27 for controlling the transparent process as a whole.
A draw command includes the data of mixing ratios which is extracted by the draw command decoding portion 24 and is stored in the mixing ratio memory 26. The mixing ratio memory 26 stores the mixing ratio for each of pixels which constitute the image generated. by the image generation portion 25 based on drawn pixel position information supplied by the image generation portion 25.
The semitransparent process is performed as follows. The read circuit 22 reads the previous pixel data Vm in the pixel position in which drawing is to be performed from the frame buffer 10 and supplies the data to the mixing circuit 21. Data Vc for the pixel to be newly drawn is supplied from the image generation portion 25 to the mixing circuit 21. The mixing ratio a for the pixel to be newly drawn is read from the mixing ratio memory 26 and is supplied to the mixing circuit 21.
In the mixing circuit 21, the pixel data Vm and Vc are mixed in the mixing ratio xcex1. Specifically, mixed output pixel data Vo is obtained from a calculation:
(1xe2x88x92xcex1)Vm+xcex1Vc=Vo
The pixel data as a result of the mixing is written back in the same address as that of the read pixel data Vm in the frame buffer 10 as described above by the write circuit 23.
At this time, the color of the previous pixel remains on the new pixel in accordance with the mixing ratio xcex1 and is displayed as a semitransparent color. If the mixing ratio xcex1=1, the color is fully opaque and, if the mixing ratio xcex1=0, the color is fully transparent.
The applicant has made the following Japanese patent applications which are related to the drawing device according to this application.
05-190763 (filed on Jun. 30, 1993)
05-190764 (filed on Jul. 2, 1993)
05-258625 (filed on Oct. 15, 1993)
06-027405 (filed on Jan. 31, 1994)
Each of the above applications is owned by the assignee of the present invention and is hereby incorporated by reference. (Applications for U.S. patent corresponding to these four Japanese patent applications are pending.)
As described above, in the conventional semitransparent process, a draw command includes the values of mixing ratios xcex1 based on which a mixing ratio xcex1 is stored in the mixing ratio memory 26 for each pixel. Therefore, when the mixing ratios are minutely set, the number of bits required for the mixing ratios xcex1 becomes large. This results in an increase in the amount of data of a draw command which necessitates an increase in the capacity of the mixing ratio memory 26.
In order to simplify the configuration of a drawing device, it is desirable to have the capability of the full transparent and full opaque processes included in the semitransparent process. As described above, however, in the semitransparent process, three steps of processing, i.e., reading from the frame buffer 10, mixing, and writing back in the frame buffer 10, must be performed for each pixel, and this results in a problem in that the processing time becomes relatively long.
It is an object of the present invention to provide an image generation apparatus which does not necessitate an increase in the amount of data of a draw command and which can employ a mixing ratio memory of a small capacity.
It is another object of the present invention to provide an image generation apparatus capable of performing full transparent and full opaque processes utilizing a semitransparent process at high speed.
In order to solve the above-described problem, according to the present invention, there is provided an image generation apparatus wherein draw commands generated by a CPU 42 are transferred to a drawing device portion 61 which generates an image on a frame buffer 63 by performing drawing sequentially in accordance with the draw commands, the drawing device portion 61 comprising a read means 102 for reading the pixel data of the image which has been previously drawn from the frame buffer 63, a mixing circuit 101 for mixing the pixel data read from the frame buffer 63 and the pixel data of the corresponding position where the next drawing operation is to be performed in a specified mixing ratio, a write means 103 for writing pixel data as a result of the mixing at the mixing circuit 101 in the corresponding pixel position in the frame buffer 63, a mixing ratio memory portion 106 for storing a plurality of the mixing ratios, and a selection means 107 for selecting the mixing ratio to be supplied to the mixing circuit 101 from the mixing ratio memory portion 106 according to mixing ratio selection information included in the draw command.
According to another aspect of the present invention, there is provided an image generation apparatus wherein draw commands generated by a CPU 42 are transferred to a drawing device portion 61 which generates an image on a frame buffer 63 by performing drawing sequentially in accordance with the draw commands, the drawing device portion 61 comprising a means 102 for reading the pixel data of the image which has been previously drawn from the frame buffer 63, a mixing circuit 101 for mixing the pixel data read from the frame buffer 63 and the pixel data of the corresponding position where the next drawing operation is to be performed in a specified mixing ratio, a write means 103 for writing pixel data as a result of the mixing at the mixing circuit 101 in the corresponding pixel position in the frame buffer 63, a mixing ratio memory portion 106 for storing the mixing ratio supplied to the mixing circuit 101, a flag determination means 109 for extracting a flag associated with the mixing process included in the draw command and for determining the state of the flag, and a control means 18 for performing control based on the result of the determination by the flag determination means 109 such that, if the flag is in one state, the reading of the pixel data from the frame buffer 63 by the read means 102 is omitted and the pixel data of the corresponding position where the next drawing operation is to be performed is written as it is in the corresponding pixel position in the frame buffer 63 by the write means 103 and such that, if the flag is in another state, the reading of the pixel data from the frame buffer 63 by the read means 102 and the writing into the frame buffer 63 by the write means 103 are omitted.
According to the present invention having the configuration as described above, information on mixing ratios is stored in the mixing ratio memory portion 106 of the drawing device portion 61 in advance. A draw command includes selection information indicating the mixing ratios to be used among those stored in the mixing ratio memory portion 106. The mixing ratios to be supplied to the mixing circuit 101 are determined based on this selection information. It is only required to prepare this selection information for each pixel. Since this selection information requires only the number of bits that allows selection from the mixing ratios stored in the mixing ratio memory portion 106, the number of bits can be smaller than that in the prior art wherein the mixing ratios themselves must be included in a draw command. This results not only in a decrease in the amount of data in a draw command but also in a reduction in the memory capacity required for the selection of the mixing ratios.
According to the second aspect of the invention, the determination means 109 determines whether the full transparent process (mixing ratio=0) or full opaque process (mixing ratio=1) is to be performed from the flag of one bit included in the draw command.
In the case of the full transparent process, neither the reading of pixel data from the frame buffer 63 by the read circuit 102 nor the writing into the frame buffer 63 by the write circuit 103 is performed. As a result, the full transparent process can be performed at high speed even with a semitransparent processing device having the mixing circuit 101, read circuit 102, and write circuit 103 because the read and write processes are skipped.
In the case of the full opaque process, the reading of pixel data from the frame buffer 63 by the read circuit 102 is not performed and only the writing of new data in the frame buffer by the write circuit 103 is performed. Therefore, the processing speed is improved also in this case because the process of reading pixel data from the frame buffer 63 is skipped.
As described above, according to the present invention, a draw command does not need to include mixing ratios themselves for the semitransparent process but it needs only index data for selecting desired mixing ratios from a mixing ratio table provided in the drawing device portion. This results in a reduction in the number of bits required. In addition, the drawing device portion needs only a memory for storing the mixing ratio table and a memory for storing index data. Therefore, it is possible to use memories of small capacities.
According to the second aspect of the invention, even with a circuit for semitransparent processing, full opaque and full transparent processes can be performed at high speed because the reading of pixel data from the frame buffer can be skipped in the former and the reading of pixel data from the frame buffer and the writing of pixel data back in the frame buffer can be skipped in the latter.